From bae4347abeaa2a66d213758f790058f42cb71fd1 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Wed, 14 Jun 2023 11:19:44 -0400 Subject: [PATCH] pull: Add error prefixing for corrupt checksums I got a bug report with the bare error ``` error: Invalid checksum of length 0 expected 32 ``` And I'm pretty sure it's from here. Add error prefixing so we know exactly which metadata object was corrupt. --- src/libostree/ostree-repo-pull.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libostree/ostree-repo-pull.c b/src/libostree/ostree-repo-pull.c index 7c0598a8..0dd97664 100644 --- a/src/libostree/ostree-repo-pull.c +++ b/src/libostree/ostree-repo-pull.c @@ -734,11 +734,11 @@ scan_dirtree_object (OtPullData *pull_data, const char *checksum, const char *pa const guchar *tree_csum_bytes = ostree_checksum_bytes_peek_validate (tree_csum, error); if (tree_csum_bytes == NULL) - return FALSE; + return glnx_prefix_error (error, "Parsing dirtree %s tree child %s", checksum, dirname); const guchar *meta_csum_bytes = ostree_checksum_bytes_peek_validate (meta_csum, error); if (meta_csum_bytes == NULL) - return FALSE; + return glnx_prefix_error (error, "Parsing dirtree %s meta child %s", checksum, dirname); g_autofree char *subpath = g_strconcat (path, dirname, "/", NULL); queue_scan_one_metadata_object_c (pull_data, tree_csum_bytes, OSTREE_OBJECT_TYPE_DIR_TREE, -- 2.30.2